<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>校园综合服务系统</title>
    <head>
        <script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.8.0.js"></script>
        <script>
            $(document).ready(function(){
                $("form").submit(function(event){
                    event.preventDefault();
                    var formData = $(this).serialize();
                    $.post("http://localhost/user/login",formData,function (response){
                        var data = $.parseJSON(response)
                        if (data.code == "00000") {
                            alert("登录成功，点击跳转")
                            window.localStorage.setItem("username", data.data)
                            $(location).attr("href", "user_courses.html")
                        } else {
                            alert("帐号名或密码错误")
                        }
                    });
                });
            });
        </script>
        </head>
    <style>
        .container {
            text-align: center;
        }
    </style>
</head>
<body>
    <div class="container">
        <h1>校园综合服务系统</h1>
        <form action="#" method="post">
            帐号：<input type="text" name="username"><br>
            密码：<input type="password" name="password"><br>
            <input type="radio" name="userType" value="1">管理员
            <input type="radio" name="userType" value="2">教师
            <input type="radio" name="userType" value="3">学员<br>
            <input id="login" type="submit" value="登录">
        </form>
    </div>
    


</body>
</html>